<?php


namespace app\api\controller;


use app\api\model\Category as CategoryModel;
use app\api\model\WxMessage;
use app\common\model\AppointmentOrder as AppointmentOrderModel;
use app\common\model\AppointmentRecord;
use think\Controller;

class Test extends Controller
{
    public function t5()
    {
        $params = [
            'client_name'=>'打鼓铜须',
            'server_user_name'=>'轩辕青峰',
            'server_name'=>'南宫先生',
            'mobile'=>18838186778
        ];
        WxMessage::sendMessage(12,$params);
    }

    public function t4()
    {
        $list = AppointmentRecord::all(['order_id'=>529]);
        $list = collection($list)->toArray();
        var_dump($list);
    }

    public function t3()
    {
        $list = array_values(CategoryModel::getCacheTree(true));
        var_dump($list);
    }

    public function t1()
    {
        $model = new AppointmentOrderModel;

        $list = $model::where(['is_delete'=>0])->field('count(service_status) as num,service_status')->group('service_status')->select();
        $list = collection($list)->toArray();
        var_dump($list);
    }

    public function t2(){
        $var1 = 'https://hongbiaoapi.bigchun.com/order/index/table ';
        $var2 = './table.png';
        shell_exec("wkhtmltoimage --quality 30 " . $var1 . $var2);
    }
}